package com.smh.a03converStreamDemo1;

import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;

public class ConvertStreamDemo2 {
    public static void main(String[] args) throws IOException {

        //淘汰
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("day27-code\\file\\demo1\\b.txt"), "GBK");


        osw.write("阿斯顿撒旦");
        osw.close();
        //掌握
        FileWriter fw = new FileWriter("day27-code\\file\\demo1\\b.txt", Charset.forName("GBK"));

        fw.write("撒旦撒撒旦请问");
        fw.close();


    }
}
